/**
 * 
 */
package com.sf.osms.dep.groovy

import com.sf.osms.dep.domain.Router
import java.util.List
import java.util.Map
import java.util.Calendar
import java.util.Date
import com.sf.osms.dep.processor.util.DateUtil
/**
 * @author sfhq1405
 *
 */
public class KixBarTimeRepair implements GroovyInterface{

	
	/* (non-Javadoc)
	 * @see com.sf.osms.dep.groovy.GroovyInterface#hanleCorrectRoutersList(java.util.List)
	 */
	public void hanleCorrectRoutersList(List list){
		// TODO Auto-generated method stub
	}
	
	/* (non-Javadoc)
	 * @see com.sf.osms.dep.groovy.GroovyInterface#handleSimgleOrginalRouter(java.util.Map)
	 */
	public void handleSimgleOrginalRouter(Map map){
		
		if(map['8'].length() == 0){
			map['11'] = '612';
		}else if(map['8'].length() > 2 && map['8'].substring(1,2).equals("0")){
			map['11'] = '16';
		}else if(map['9'].length() != 0){
			map['11'] = '14';
		}else if(map['11'].equals("2") || map['11'].equals("3")){
			map['11'] = '15';
		}else{
			map = null;
		}
		
		if(null != map){
			def barTime = map['10'];
			if(!barTime){
				if('15' == map['11'] || '16' == map['11'] || '612' == map['11']){
					int hour = new Date().getHours();
					if(hour > 14){
						map['10'] = '12:00:00';
					}else{
						map['10'] = '18:00:00';
					}
				}else{
					map['10'] = DateUtil.dateFomat(new Date(),"HH:mm:ss");
				}
				
			}
		}
		
	}
	
	/* (non-Javadoc)
	 * @see com.sf.osms.dep.groovy.GroovyInterface#handleSimgleRouter(com.sf.osms.dep.domain.Router)
	 */
	public void handleSimgleRouter(Router router){
		if(router.agentNetNum){
			if('NRT' == router.agentNetNum){
				router.netNum = 'NRT01R';
				router.operatorId = '420004';
			}else if('KIX' == router.agentNetNum){
				router.netNum = 'KIX01R';
				router.operatorId = '420005';
			}
		}
	}
	
	
}
